package org.inspursc.s0517.health.evaluation.service;

import org.inspursc.s0517.health.evaluation.dto.SurveyDTO;
import org.inspursc.s0517.health.evaluation.dto.SurveyQuDetailDTO;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

public interface SurveyService {

    /**
     * 新增问卷
     *
     * @param surveyDTO
     * @return
     * @throws Exception
     */
    SurveyDTO saveSurvey(SurveyDTO surveyDTO);

    /**
     * 修改调查问卷
     *
     * @param surveyDTO
     * @return
     */
    SurveyDTO updateSurvey(SurveyDTO surveyDTO);


    /**
     * 获取所有调查问卷
     *
     * @return
     */
    List<SurveyDTO> findSurvey();


    /**
     * 根据权限获取问卷列表：查询出当前登录用户所属机构能够查看问卷列表
     *
     * @param request
     * @return
     */
    List<SurveyDTO> findSurveyByOrgIdAndUserId(HttpServletRequest request) throws Exception;

    /**
     * 根据调查问卷Id获取调查问卷
     *
     * @param surveyId
     * @return
     */
    SurveyDTO findOneSurvey(Integer surveyId);


    /**
     * 根据ID获取含有分类数据的调查问卷详情
     *
     * @param surveyId
     * @return
     */
    SurveyQuDetailDTO findOneSurveyDetail(Integer surveyId) throws Exception;


    /**
     * 删除调查问卷
     *
     * @param suId
     * @return
     */
    boolean deleteSurvey(Integer suId);

}
